package com.bdqn.Service.SuppMaterial.impl;

import com.bdqn.Service.SuppMaterial.SuppMaterialService;
import com.bdqn.entity.Material;
import com.bdqn.entity.SuppMaterial;
import com.bdqn.mapper.Material.MaterialMapper;
import com.bdqn.mapper.SuppMaterial.SuppMaterialMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;
@Service
public class SuppMaterialServiceImpl implements SuppMaterialService {
    @Resource
    private SuppMaterialMapper suppMaterialMapper;
    @Resource
    private MaterialMapper materialMapper;
    /**
     * 查询当前登录的供应商的所有产品
     */

    @Override
    public List<SuppMaterial> selectSuppMaterialBy(Integer id, String MATERIAL_NUM, String MATERIAL_NAME, String orderby, Integer pageNum, Integer pageSize) {
        return suppMaterialMapper.selectSuppMaterialBy(id,MATERIAL_NUM,MATERIAL_NAME,orderby,pageNum,pageSize);
    }

    @Override
    public int SuppMaterialDeleteBy(Integer sid, int mid) {
        return suppMaterialMapper.SuppMaterialDeleteBy(sid,mid);
    }

    @Override
    public int SuppMaterialCountBy(Integer id, String material_num, String material_name) {

        return suppMaterialMapper.SuppMaterialCountBy(id,material_num,material_name);
    }

    @Override
    public int addSuppMaterial(int sid, Integer mid) {
                int de=suppMaterialMapper.addSuppMaterial(sid,mid);
        return de;
    }

    @Override
    public SuppMaterial selectSuppMaterialByIds(Integer sid, int mid) {
        return suppMaterialMapper.selectSuppMaterialByIds(sid,mid);
    }

}
